package com.tanjie.blackbean.pojo.auth;

import com.tanjie.blackbean.pojo.system.ClientType;
import com.tanjie.blackbean.pojo.system.UserType;
import lombok.Data;

import java.io.Serializable;
import java.util.StringJoiner;

/**
 * @author tanjie
 * @since 2021-11-01
 */
@Data
public class UserInfo implements Serializable {

    private static final long serialVersionUID = -5135800610394544442L;

    private String id;

    private String username;

    private String nickname;

    private String realName;

    private String orgId;

    private String orgName;

    private String orgLogo;

    private String orgFullName;

    private UserType userType;

    private ClientType clientType;

    private Integer status;

    @Data
    public static class Role {

        private String id;

        private String name;

        private String code;

        private Boolean isPublic;

    }

    @Data
    public static class Permission {

        private String id;

        private String name;

        private String menuId;

        private String apiPerm;

        private String btnPerm;

    }

    @Override
    public String toString() {
        return new StringJoiner(", ", "[", "]")
                .add("id='" + id + "'")
                .add("username='" + username + "'")
                .add("orgId='" + orgId + "'")
                .add("orgName='" + orgName + "'")
                .add("userType=" + userType)
                .add("clientType=" + clientType)
                .add("status=" + status)
                .toString();
    }
}
